unit drv_unit;
 interface
var
   icdev:integer;//COM1,COM2,ParallelPort 公用设备句柄
   st:smallint;
  procedure quit;
 //comm function
 Function fw_init(prot:integer;baud:longint):integer; stdcall;
  far;external 'umf.dll' name 'fw_init';

 Function fw_exit(icdev:integer):smallint; stdcall;
  far;external 'umf.dll' name 'fw_exit' ;

 Function fw_card(icdev:integer;mode:smallint;var snr:longword):smallint; stdcall;
  far;external 'umf.dll' name 'fw_card';

 Function fw_config_card(icdev:integer;cardtype:smallint):smallint; stdcall;
  far;external 'umf.dll' name 'fw_config_card';

 Function fw_halt(icdev:integer):smallint; stdcall;
  far;external 'umf.dll' name 'fw_halt';


 Function fw_beep(icdev:integer;stime:smallint):smallint; stdcall;
  far;external 'umf.dll' name 'fw_beep';

 Function fw_setcpu(icdev:THandle;SAMid:Byte):smallint;stdcall;
 far;external 'umf.dll' name 'fw_setcpu';

 Function fw_reset(icdev:THandle;Msec:smallint):smallint;stdcall;
 far;external 'umf.dll' name 'fw_reset';


 Function a_hex(abuf:pchar;hexbuf:pchar;alen:integer):smallint;stdcall;
 far;external 'umf.dll' name 'a_hex';

 Function hex_a(hexbuf:pchar;abuf:pchar;hexlen:integer):smallint;stdcall;
 far;external 'umf.dll' name 'hex_a';


 //接触式CPU/SAM card funcitons
 function fw_cpureset(icdev:THandle;rlen:pchar;rdata:pchar):smallint;stdcall;
 far;external 'umf.dll' name 'fw_cpureset';



 Function fw_cpuapdu(icdev:THandle;slen:Byte;sdata:pchar;rlen:pchar;rdata:pchar):smallint;stdcall;
 far;external 'umf.dll' name 'fw_cpuapdu';

 //非接CPU  card functions
 Function fw_pro_reset(icdev:integer;rlen:pchar;rdata:pchar):smallint;stdcall;
 far;external 'umf.dll' name 'fw_pro_reset';

 Function fw_pro_commandlink(icdev:integer;slen:Byte;sdata:pchar;rlen:pchar;rdata:pchar;ftt:Byte;fFG:Byte):smallint;stdcall;
 far;external 'umf.dll' name 'fw_pro_commandlink';




implementation

procedure quit;
  begin
    If icdev > 0 Then begin
       st := fw_reset(icdev, 10);
       st := fw_exit(icdev);
       icdev := -1;
    end;
end;
{
initialization
begin

end;

finalization
begin
end;
 }
end.